package xyz.qq66179820.config;

import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * TODO
 *
 * @author lihj
 * @date 2022/1/23
 */
@Configuration
public class AppConfig {

    @LoadBalanced // 负载均衡(默认轮询方式) 否则报错：java.net.UnknownHostException:
    @Bean
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }
}
